﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IanWebkitBrowser
{
    class ScriptCode
    {
        public static string TestHandlerCode = @"
var exampleA;
    if (!exampleA) exampleA = {};
    (function() {
        exampleA.__defineGetter__('myParam',
        function() {
            native function GetMyParam();
            return GetMyParam();
        });
        exampleA.__defineSetter__('myParam',
        function(arg0) {
            native function SetMyParam(arg0);
            SetMyParam(arg0);
        });
        exampleA.myFunction = function() {
            native function MyFunction();
            return MyFunction();
        };
        exampleA.getMyParam = function() {
            native function GetMyParam();
            return GetMyParam();
        };
        exampleA.setMyParam = function(arg0) {
            native function SetMyParam(arg0);
            SetMyParam(arg0);
        };
        exampleA.sayHello = function(){
            native function SayHello();
            return SayHello();
        };
    })();";
        public static string ProcessControllerHandlerCode = @"
var processController;
if(!processController) processController={};
(function(){

processController.Init=function(str){
    native function Init(str);
    Init(str);
};

processController.Load=function(){
    native function Load();
    Load();
};

processController.UnLoad=function(){
    native function UnLoad();
    UnLoad();
};

processController.Timeout=function(){
    native function Timeout();
    Timeout();
};

processController.Go=function(url){
    native function Go(url);
    Go(url);
};

processController.Call=function(type,json){
    native function Call(type,json);
    Call(type,json);
};

processController.GoBack=function(){
    native function GoBack();
    GoBack();
};

processController.Lock=function(url){
    native function Lock(url);
    Lock(url);
};
})();
";
    }
}
